PART B - step 1: Setting up the HTML
|
For our example, we will use the exact same layout as the Tiny Little Strips example in the Putting Music On a Page tutorial. Take a look at the sample below and you will see how playing multiple songs at the same time could be a tad bothersome to an end-user.
|
"Ambient" by Brian Salter
|
|
|
"Classical" arranged by Brian Salter
|
|
|
"Jungle" by Brian Salter
|
|
|
"Lounge" by Brian Salter
|
|
|
"Modern Rock" by Paul Sebastien
|
|
Looking at the source HTML for this step, you can see that this is no plain embedding of Beatnik players in a table. Although the layout used for this example is exactly the same as the Tiny Little Strips example, here we have used Music Object's magicEmbed method to embed the players instead of using the plain HTML technique. We have done this in preparation for the next step where we will need to use the Music Object callback methods to register callback handlers for each of the players. Towards the beginning of the source code you will notice that a Music Object instance has been created for each player instance.
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
music1 = new Music ();
music2 = new Music ();
music3 = new Music ();
music4 = new Music ();
music5 = new Music ();
// --></SCRIPT>
<CENTER>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=6>
<TR BGCOLOR=EEEEEE>
<TD>
"<B>Ambient</B>" by Brian Salter
</TD>
<TD>
<SCRIPT LANGUAGE=JavaScript><!-- //
music1.magicEmbed (
'SRC="ambient.rmf" ' +
'WIDTH=144 ' +
'HEIGHT=15 ' +
'DISPLAY=SONG ' +
'AUTOSTART=FALSE ' +
'LOOP=FALSE'
);
// --></SCRIPT>
</TD>
</TR>
<TR BGCOLOR=DDDDDD>
<TD>
"<B>Classical</B>" arranged by Brian Salter
</TD>
<TD>
<SCRIPT LANGUAGE=JavaScript><!-- //
music2.magicEmbed (
'SRC="classical.rmf" ' +
'WIDTH=144 ' +
'HEIGHT=15 ' +
'DISPLAY=SONG ' +
'AUTOSTART=FALSE ' +
'LOOP=FALSE'
);
// --></SCRIPT>
</TD>
</TR>
<TR BGCOLOR=CCCCCC>
<TD>
"<B>Jungle</B>" by Brian Salter
</TD>
<TD>
<SCRIPT LANGUAGE=JavaScript><!-- //
music3.magicEmbed (
'SRC="jungle.rmf" ' +
'WIDTH=144 ' +
'HEIGHT=15 ' +
'DISPLAY=SONG ' +
'AUTOSTART=FALSE ' +
'LOOP=FALSE'
);
// --></SCRIPT>
</TD>
</TR>
<TR BGCOLOR=BBBBBB>
<TD>
"<B>Lounge</B>" by Brian Salter
</TD>
<TD>
<SCRIPT LANGUAGE=JavaScript><!-- //
music4.magicEmbed (
'SRC="lounge.rmf" ' +
'WIDTH=144 ' +
'HEIGHT=15 ' +
'DISPLAY=SONG ' +
'AUTOSTART=FALSE ' +
'LOOP=FALSE'
);
// --></SCRIPT>
</TD>
</TR>
<TR BGCOLOR=AAAAAA>
<TD>
"<B>Modern Rock</B>" by Paul Sebastien
</TD>
<TD>
<SCRIPT LANGUAGE=JavaScript><!-- //
music5.magicEmbed (
'SRC="modern-rock.rmf" ' +
'WIDTH=144 ' +
'HEIGHT=15 ' +
'DISPLAY=SONG ' +
'AUTOSTART=FALSE ' +
'LOOP=FALSE'
);
// --></SCRIPT>
</TD>
</TR>
</TABLE>
</CENTER>
<P>
|